Skip to content

Add CLI options reference documentation#13929

Closed
FazeelUsmani wants to merge 3 commits intopytest-dev:mainfrom
FazeelUsmani:add-cli-options-docs
Closed

Add CLI options reference documentation#13929
FazeelUsmani wants to merge 3 commits intopytest-dev:mainfrom
FazeelUsmani:add-cli-options-docs

Conversation

@FazeelUsmani
Copy link
Contributor

Summary

Previously, pytest command-line options were only visible via pytest --help, making them difficult to discover and browse online. This PR adds a dedicated CLI options reference page to improve discoverability and provide a better documentation experience.

Changes

Added a new documentation page (doc/en/how-to/cli-options.rst) that organizes commonly used pytest CLI options into logical categories:

  • Running and Selecting Tests (-k, -m, -x, --maxfail, --lf, --ff, --sw)
  • Output and Verbosity (-v, -q, --tb, -l, -r)
  • Reporting and Output Files (--junit-xml, --durations, -s)
  • Collection and Test Discovery (--collect-only, --pyargs, --ignore)
  • Debugging (--pdb, --trace, --fixtures, --setup-show)
  • Configuration (-c, --basetemp, -o)
  • Logging (--log-cli-level, --log-level, --log-file)
  • Warnings (--disable-warnings, -W)
  • Common Option Combinations for typical workflows

Each section includes clear examples, brief explanations, and cross-references to related documentation. The page also links to the complete command-line flag reference for users who need the exhaustive list.

Files Changed

  • Added doc/en/how-to/cli-options.rst - new CLI options reference page (307 lines)
  • Updated doc/en/how-to/index.rst - added the new page to the table of contents
  • Added changelog/4492.doc.rst - changelog entry

Testing

The documentation was successfully built using Sphinx with no errors. All cross-references are valid and the generated HTML renders correctly.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 11, 2025
@FazeelUsmani FazeelUsmani marked this pull request as draft November 11, 2025 13:56
@FazeelUsmani FazeelUsmani deleted the add-cli-options-docs branch November 11, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant